package com.john.cloud.feigin.sender;

import com.john.cloud.feigin.entity.User;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: JohnCoding
 * @Description:
 * @date: 2020/4/24 17:21
 */
@Component
public class UserSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send(User user){
        System.out.println("Sender object: " + user.toString());
        this.rabbitTemplate.convertAndSend("object",user);
    }

}
